﻿#ifndef PST_TABLEFILTERSELECTDATABAR_H
#define PST_TABLEFILTERSELECTDATABAR_H

#include <QWidget>
#include "ui_TableFilterSelectDataBar.h"
#include "DataChosenListDialog.h"

namespace pst 
{
    class TableFilterSelectDataBar : public QWidget
    {
        Q_OBJECT
    
    public:
        void addItem(const QString header, const QStringList value, const int index);
        void getSelectData(const QModelIndexList& chosenID);

        // python
        void pyUpdateItem(const QStringList value);

    public:
        TableFilterSelectDataBar(QWidget* parent = nullptr);
        ~TableFilterSelectDataBar();
        void updateData(QStringList list);

    signals:
        void signal_flushTableBySelectedRow(QHash<int, QStringList> *map, bool savePy = true);
        
    private:
        Ui::TableFilterSelectDataBar* ui;
        DataChosenListDialog* m_dataChosenListDialog;
        int m_barIndex;
        QList<int> m_selectedIndexs;
        QStringList m_result = {};
        QMap<QString, int> m_valueMap;


    private slots:
        void slot_more();
    };
}
#endif
